package com.daleige.system;

import java.io.File;
import java.io.IOException;

public class RuntimeUtil {

	public static void excuteCommand(String command) throws IOException {
		Runtime r = Runtime.getRuntime();
		r.exec(command);
	}
	
	/**
	 * 
	 * @Description (使用记事本打开某文件)
	 * @throws IOException
	 */
	public static String openNotepad(String dirName) {
		
		File dir = new File(dirName);// 创建目录
		if (dir.exists()) {
			try {
				excuteCommand("cmd /c start notepad " + dirName);
				return null;
			} catch (IOException e) {	
				return "打开记录失败!";
			}
		}
		return "日志文件不存在！";
	}
}
